package test.json;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import org.json.JSONObject;

import com.sun.media.jfxmedia.events.NewFrameEvent;

public class JsonValidatorException {
	public static void main(String[] args) throws IOException {
		InputStream is = new FileInputStream("src/resources/test1.data");
		byte[] bytes = new byte[4000];
		is.read(bytes);
		String jsonString = new String(bytes);
		System.out.println(jsonString);
		long start = System.currentTimeMillis();
		try {
			JSONObject jsonObject = new JSONObject(jsonString);
			System.out.println(true);
			long end = System.currentTimeMillis();
			System.out.println(end - start);
		} catch (Exception e) {
			System.out.println(false);
			long end = System.currentTimeMillis();
			System.out.println(end - start);
		}
	}
}
